package com.cg.design.graphicdesignpattern.bridge;

import org.junit.Test;

/**
 * Bridge桥接模式测试类
 *
 * @program: LeetCode->BridgeTest
 * @description: Bridge桥接模式测试类
 * @author: cg
 * @create: 2022-03-24 00:06
 **/
public class BridgeTest {

    @Test
    public void testBridge() {
        Display display1 = new Display(new StringDisplayImpl("Hello, China."));
        Display display2 = new CountDisplay(new StringDisplayImpl("Hello, World."));
        CountDisplay display3 = new CountDisplay(new StringDisplayImpl("Hello, Universe."));
        RandomCountDisplay display4 = new RandomCountDisplay(new StringDisplayImpl("Hello, Chenyumeng."));
        CountDisplay display5 = new CountDisplay(new FileDisplayImpl("start.txt"));
        IncreaseDisplay display6 = new IncreaseDisplay(new CharDisplayImpl('<', '*', '>'), 1);
        IncreaseDisplay display7 = new IncreaseDisplay(new CharDisplayImpl('|', '#', '-'), 2);
        display1.display();
        display2.display();
        display3.display();
        display3.multiDisplay(5);
        display4.randomDisplay(10);
        //display5.multiDisplay(3);
        display6.increaseDisplay(4);
        display7.increaseDisplay(6);
    }
}
